const axios = require('axios');
const crypto = require('crypto-js');

var c = (new Date()).getTime();
var d = "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAIQ3aWYA";
var s = 1e6 * Math.random();
var H = {
    'page': 4,
    'pageSize': 10,
    'categoryId': '60',
    'unitId': 1
  }
var h = JSON.stringify(H);
g = "body=" + h + "&";
g = g + "timestamp=" + c + "&nonceStr=" + s + "&key=" + d;
var S = crypto.MD5(g).toString();

(async () => {
  try {
    const response = await axios.post(
      'https://wuhan.hbdzcg.com.cn/e-commodity/act/index/goods/search',H,
      {
        headers: {
          'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
          'Connection': 'keep-alive',
          'Origin': 'https://wuhan.hbdzcg.com.cn',
          'Referer': 'https://wuhan.hbdzcg.com.cn/',
          'Sec-Fetch-Dest': 'empty',
          'Sec-Fetch-Mode': 'cors',
          'Sec-Fetch-Site': 'same-origin',
          'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36 Edg/135.0.0.0',
          'nonceStr': s,
          'sec-ch-ua': '"Microsoft Edge";v="135", "Not-A.Brand";v="8", "Chromium";v="135"',
          'sec-ch-ua-mobile': '?0',
          'sec-ch-ua-platform': '"Windows"',
          'signature': S,
          'timestamp': c
        }
      }
    );
    console.log('响应数据:', response.data);
    debugger;
  } catch (error) {
    console.error('请求错误:', error);
    debugger;
  }
})();